<%--
  Created by IntelliJ IDEA.
  User: ZSH
  Date: 2022/1/6
  Time: 11:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <h1>scope.jsp</h1>
    <%
        //4个域中都存放了键值对
        pageContext.setAttribute("key","pageContext");
        request.setAttribute("key","request");
        session.setAttribute("key","session");
        application.setAttribute("key","application");
    %>
    pageContext域：<%=pageContext.getAttribute("key")%><br>
    request域：<%=request.getAttribute("key")%><br>
    session域：<%=session.getAttribute("key")%><br>
    application域：<%=application.getAttribute("key")%><br>

<%--    <% request.getRequestDispatcher("/scope2.jsp").forward(request,response);%>--%>
    <jsp:forward page="/scope2.jsp"></jsp:forward>
</body>
</html>
